package cn.pzaily.orange.backup.service.impl;

import cn.pzaily.orange.backup.service.MysqlBackupService;
import cn.pzaily.orange.core.utils.sql.MySqlBackupRestoreUtils;
import org.springframework.stereotype.Service;

/**
 * @PackageName: cn.pzaily.orange.backup.service.impl
 * @Description:
 * @Author: Pang
 * @Date: 2021-05-14 12:17
 */
@Service
public class MysqlBackupServiceImpl implements MysqlBackupService {

    @Override
    public boolean backup(String host, String username, String password, String backupFolderPath, String fileName, String database) throws Exception {
        return MySqlBackupRestoreUtils.backup(host, username, password, backupFolderPath, fileName, database);
    }

    @Override
    public boolean restore(String restoreFilePath, String host, String username, String password, String database) throws Exception{
        return MySqlBackupRestoreUtils.restore(restoreFilePath, host, username, password, database);
    }
}
